package com.topView2;

/**
 * @Author: huangzhigao
 * @Date: 2023/2/12 14:00
 */
public class leecode26 {
    public int removeDuplicates(int[] nums) {

        int left = 0;
        int fast = 0;
        while (fast < nums.length) {
            if (nums[left] == nums[fast]) {
                fast++;
            } else {
                nums[++left] = nums[fast];
            }
        }
        return left + 1;
    }
}
